def quicksort(listinput):
    if len(listinput) <= 1:
        return listinput
    leftlist = []
    rightlist = []
    mindlist = []
    key = listinput[0]
    for i in listinput:
        if i > key:
            rightlist.append(i)
        elif i < key:
            leftlist.append(i)
        else:
            mindlist.append(i)

    right = quicksort(rightlist)
    left = quicksort(leftlist)
    return left + mindlist + right

print(quicksort([2,1,4,2,4,3,6,9,7,86]))
